GDK: Avoid using constructors on Win32
authorLuca Bacci <luca.bacci982@gmail.com>
Thu, 3 Mar 2022 13:07:48 +0000 (14:07 +0100)
committerLuca Bacci <luca.bacci982@gmail.com>
Thu, 3 Mar 2022 20:44:38 +0000 (21:44 +0100)
The constructors in GDK only have a meaning for UNIX, on Windows
they are useless.

gdk/gdk.c

index f0869a6a81feccdce03b58caf9b54661c3278f02..83672d8f87c88ab7f4001808882d689bc6283a9d 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -1132,7 +1132,8 @@ gdk_unichar_direction (gunichar ch)
     return PANGO_DIRECTION_LTR;
 }
 
-#ifdef G_HAS_CONSTRUCTORS
+#if defined (G_HAS_CONSTRUCTORS) && !defined (G_OS_WIN32)
+#define GDK_USE_CONSTRUCTORS
 #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
 #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(stash_startup_id)
 #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(stash_autostart_id)
@@ -1175,7 +1176,7 @@ gdk_get_desktop_startup_id (void)
 
   if (g_once_init_enter (&init))
     {
-#ifndef G_HAS_CONSTRUCTORS
+#ifndef GDK_USE_CONSTRUCTORS
       stash_startup_id ();
 #endif
       /* Clear the environment variable so it won't be inherited by
@@ -1196,7 +1197,7 @@ gdk_get_desktop_autostart_id (void)
 
   if (g_once_init_enter (&init))
     {
-#ifndef G_HAS_CONSTRUCTORS
+#ifndef GDK_USE_CONSTRUCTORS
       stash_autostart_id ();
 #endif
       /* Clear the environment variable so it won't be inherited by